import request from '@/plugins/axios/request';
let baseURL = process.env.VUE_APP_BASE_API + "/department"

// [部门接口]添加部门
export function departmentCreate(data) {
  return request({
    url: `${baseURL}/departmentCreate`,
    method: 'post',
    data: data
  })
}

// [部门接口]修改部门名称
export function departmentUpdate(data) {
  return request({
    url: `${baseURL}/departmentUpdate`,
    method: 'post',
    data: data
  })
}

// [部门接口]获取部门详情
export function departmentDetail(data) {
  return request({
    url: `${baseURL}/departmentDetail/` + data,
    method: 'post',
    data: data
  })
}

// [部门接口]删除部门
export function removeDepartment(data) {
  return request({
    url: `${baseURL}/removeDepartment`,
    method: 'post',
    data: data
  })
}

// [部门接口]批量添加成员到部门
export function joinDepartment(data) {
  return request({
    url: `${baseURL}/joinDepartment`,
    method: 'post',
    data: data
  })
}

// [部门接口]部门管理添加用户-用户列表
export function memberList(data) {
  return request({
    url: `${baseURL}/memberList`,
    method: 'post',
    data: data
  })
}

// [部门接口]批量移除部门
export function quitDepartment(data) {
  return request({
    url: `${baseURL}/quitDepartment`,
    method: 'post',
    data: data
  })
}

// 获取部门树形结构
export function departmentTree(data) {
  return request({
    url: `${baseURL}/manageDepartmentTree`,
    method: 'POST',
    data: data
  })
}
